package com.smart.manager.product.entities.body;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.product.entities.enums.GoodsMode;
import com.smart.manager.product.entities.enums.PigstyKind;
import com.smart.manager.product.entities.enums.ProfileStage;
import com.smart.manager.product.entities.views.PigBreedView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * 猪仔配置 - 日龄等级
 * @author leo
 * @date 2023/09/07
 */
public class RPigLevel {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RPigLevel1")
    public static class SearchBody extends BaseSearch {

        @ApiModelProperty("等级序号")
        private String code;

        @ApiModelProperty("所属阶段")
        private ProfileStage stage;

        @ApiModelProperty("喂养类型")
        private PigstyKind kind;

        @ApiModelProperty("适用品种")
        private PigBreedView breed;

        @ApiModelProperty("是否允许宰杀")
        private Boolean allowKill;
    }


    @Data
    @ApiModel("RPigLevel2")
    public static class EditBody  implements Serializable {

        @ApiModelProperty("适用品种")
        @NotNull(message = "适用品种 不能为空")
        @Valid
        private PigBreedView breed;

        @ApiModelProperty("猪仔等级")
        @NotNull(message = "等级值 不能为空")
        @Max(value = 500  ,message = "猪仔等级不能超过500级")
        private Integer levelNum;

        @ApiModelProperty("成长天数")
        @NotNull(message = "成长天数 不能为空")
        @Min(value = 1,message = "成长天数 不能小于1")
        private Integer day;

        @ApiModelProperty("喂养类型")
        @NotNull(message = "喂养类型 不能为空")
        private PigstyKind kind;

        @ApiModelProperty("所属阶段")
        @NotNull(message = "所属阶段 不能为空")
        private ProfileStage stage;

        @ApiModelProperty("预估体重KG")
        @NotNull(message = "预估体重KG 不能为空")
        @Min(value = 1,message = "预估体重KG 不能小于1")
        private Integer weight;

        @ApiModelProperty("是否允许宰杀")
        @NotNull(message = "是否允许宰杀 不能为空")
        private Boolean allowKill;


        @ApiModelProperty("喂养提示语")
        @NotBlank(message = "喂养提示语 不能为空")
        private String msg;


    }


}
